<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title th:text="${wbeParameter.name}">网站后台管理系统 </title>
    <link rel="icon" href="/resource/hospital.png"/>
    <link rel="stylesheet" href="/resource/css/normalize.css" type="text/css"/>
    <link rel="stylesheet" href="/resource/css/secondary.css" type="text/css"/>
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css" media="all"/>
    <script language="javascript" type="text/javascript" src="/resource/js/Kunyilibrary.js"></script>
</head>
<style>

    .layui-input {
        margin-top: 5px;
    }

    .layui-table tr th {
        color: #6bcbca !important;
        font-family: 微软雅黑;
    }
</style>
<body style="font-size: 12px;">
<header class="header" th:replace="proscenium/public :: header"></header>
<nav th:replace="proscenium/public :: nav"></nav>
<section class="BaseMark">
    <div class="bread">您所在的位置<span><a href="/diplomaProject">首页</a>><a>预约挂号</a></span></div>
    <div class="baseLeft">
        <div class="tools">
            <a href="/pay">
                <img src="/resource/images/ico_003.gif" width="52" height="52"><em>缴费</em>
            </a>
            <a style="margin-right:0;" href="/infoSearch" class="last">
                <img src="/resource/images/ico_004.gif" width="52" height="52"><em>信息查询</em>
            </a>
            <a style="margin-right:0;" href="/showHistory">
                <img src="/resource/images/ico_001.gif" width="52" height="52"><em>缴费记录</em>
            </a>
            <div class="clear"></div>
        </div>
    </div>
    <div class="baseRight">
        <div class="title01">预约挂号</div>
        <div class="Expert layui-form" style="padding-top: 20px">
            <div class="layui-form-item">


                <div class="layui-inline">
                    <label class="layui-form-label">上午/下午</label>
                    <div class="layui-input-inline">
                        <select id="type">
                            <option></option>
                            <option th:selected="${type  eq '上午'}">上午</option>
                            <option th:selected="${type  eq '下午'}">下午</option>
                        </select>
                    </div>
                </div>
                <div class="layui-inline">
                    <div class="layui-input-inline">
                        <button class="layui-btn-sm layui-btn search" style="width: 100px;background: #6bcbca">查询
                        </button>
                    </div>
                </div>
            </div>
            <table class="layui-table">
                <thead>
                <tr>

                    <th>日期</th>
                    <th>星期</th>
                    <th>上午/下午</th>
                    <th>医生</th>
                    <th>剩余挂号数</th>
                    <th>预约挂号</th>
                </tr>
                </thead>
                <tbody>
                <tr th:each="visit:${visitList}">

                    <td th:text="${visit.day}"></td>
                    <td th:text="${visit.week}"></td>
                    <td th:text="${visit.type}"></td>
                    <td th:text="${visit.doctorName}">人生似修行</td>
                    <td th:text="${visit.zum-visit.number}">人生似修行</td>
                    <td>
                        <button class="layui-btn-sm layui-btn registration" th:id="${visit.id}"
                                style="width: 100px;background: #6bcbca">挂号
                        </button>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div class="clear"></div>
    </div>
    <div class="clear"></div>
</section>
<div class="BottomHidden"></div>
<footer th:replace="proscenium/public :: footer"></footer>
<script language="javascript" type="text/javascript" src="/resource/js/Kunyi.Common.js"></script>
<script language="javascript" type="text/javascript" src="/resource/js/Kunyi.Secondary.js"></script>
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript" th:inline="javascript">
    layui.use(['table', 'layer', 'form'], function () {
        var table = layui.table,
            $ = layui.$,
            layer = layui.layer,
            form = layui.form;
        //查询
        $('.search').on('click', function () {
            var type = $('#type').val();
            location.href = '/appointmentReg?type=' + type;
        })
        $('.registration').on('click', function () {
            var visitId = $(this).attr("id");
            $.ajax({
                url: '/registration/registration.do',
                type: 'post',
                data: {'visitId': visitId},
                dataType: 'json',
                async: false,
                success: function (result) {
                    if (!result.status) {
                        layer.msg(result.msg, {time: 2000});
                        return false;
                    } else {
                        layer.msg("预约挂号成功!", {
                            time: 900, end: function () {
                                location.reload()
                            }
                        })
                    }
                }
            });
        })
    });
</script>
</body>
</html>